package main

import (
	"github.com/sirupsen/logrus"
	"os"
)

func initLogrusLogger(logpath string, loglevel logrus.Level) *logrus.Logger {
	file, err := os.Create(logpath)
	if err != nil {
		panic(err)
	}

	return &logrus.Logger{
		Out:   file,
		Level: loglevel,
		Formatter: &logrus.TextFormatter{
			FullTimestamp: true,
		},
	}
}
